#pragma once

#include <unordered_map>
#include <unordered_set>
#include <utility>

#include "IntegrableInterface.h"
#include "Defs.h"

namespace PHYOgre{

class World
{
public:
	/*typedef std::pair<IntegrableInterface*,IntegrableInterface*> PotentialContact;
	typedef std::unordered_set<PotentialContact> PotentialContactCollection;*/

	typedef std::unordered_map<IntegrableInterface*,IntegrableInterface*> EntityCollection;
	typedef EntityCollection::const_iterator EntityCollectionConstIterator;
	
	World(void);
	~World(void);

	void Register(IntegrableInterface* iEntity);
	void Unregister(IntegrableInterface* iEntity);

	void RunStep(const Real& iDelta);
	void UpdatePotentialContacts();

	EntityCollectionConstIterator GetIteratorBegin() const;
	EntityCollectionConstIterator GetIteratorEnd() const;
private:
	EntityCollection mEntities;
	unsigned long mStepCount;
	//unsigned long mLastPotetinalContactStep;
	//PotentialContactCollection mPotentialContacts;

};

}